package com.gxa.controller;
import com.gxa.common.R;
import com.gxa.pojo.Emp;
import com.gxa.pojo.Resume;
import com.gxa.pojo.blackPojo.BlackPojo;
import com.gxa.utils.DateUtils;
import io.swagger.annotations.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/shielding_job")
@Api(value = "拉黑员工表",tags = "拉黑员工表接口API")
public class ShieldingController {
    //查询
    @RequestMapping(value = "/findShieldingJobList",method = RequestMethod.GET)
    @ApiOperation(value = "拉黑员工查询接口",notes = "传递当前页码数和每页显示记录数",httpMethod = "GET", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数",required = true,dataType = "String",paramType = "query"),
            @ApiImplicitParam(name = "pageSize",value = "每页显示条数",required = true,dataType = "String",paramType = "query")
    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R findSysUserList(@RequestParam("currentPage") Integer currentPage, @RequestParam("pageSize") Integer pageSize){
        R r = new R();
        r.setCode(200);
        r.setMsg("success");
        List<BlackPojo> sysUserList = new ArrayList<>();
        BlackPojo blackPojo=new BlackPojo();
        Emp sys_emp01 = new Emp();
        Resume resume=new Resume();
        blackPojo.setEmp_name("admin");
        blackPojo.setEmp_sex("女");
        blackPojo.setAge("55岁");
        blackPojo.setEmp_education(1);
        blackPojo.setEmp_phone("19905059595");
        blackPojo.setEmp_dept("一事业部");
        blackPojo.setEmp_jionpic("src/img2");
        blackPojo.setEmp_idcard("123456");
        blackPojo.setEmp_quitpic("src/img3");
        blackPojo.setSelf_pic("src/img1");
        blackPojo.setDate(DateUtils.getCurrentDate());
        BlackPojo blackPojo02=new BlackPojo();
        blackPojo02.setEmp_name("root");
        blackPojo02.setEmp_sex("男");
        blackPojo02.setAge("55岁");
        blackPojo02.setEmp_education(2);
        blackPojo02.setEmp_phone("19905059595");
        blackPojo02.setEmp_dept("一事业部");
        blackPojo02.setEmp_jionpic("src/img2");
        blackPojo02.setEmp_idcard("123456");
        blackPojo02.setEmp_quitpic("src/img3");
        blackPojo02.setSelf_pic("src/img1");
        blackPojo02.setDate(DateUtils.getCurrentDate());
        blackPojo.setAll_page(10);
        blackPojo02.setAll_page(10);
        sysUserList.add(blackPojo);
        sysUserList.add(blackPojo02);
        r.setData(sysUserList);
        return r;
    }

    @RequestMapping(value = "/shieldingCancel",method = RequestMethod.GET)
    @ApiOperation(value = "取消拉黑操作",notes = "传递身份证号码",httpMethod = "GET", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "emp_IdCard",value = "身份证号码",required = true,dataType = "String",paramType = "query"),
    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R shieldingEmp(String emp_idcard){
        R r=new R();
        r.setCode(200);
        r.setMsg("取消拉黑成功");
        r.setData(null);
        return r;
    }


//    @RequestMapping(value = "/edit_emp",method = RequestMethod.GET)
//    @ApiOperation(value = "编辑操作",notes = "传递身份证号码",httpMethod = "GET", response = R.class)
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "emp_IdCard",value = "身份证号码",required = true,dataType = "String",paramType = "query"),
//    })
//    @ApiResponses({
//            @ApiResponse(code=200,message="请求成功"),
//            @ApiResponse(code=404,message="找不到页面"),
//            @ApiResponse(code=500,message="后台服务错误")
//    })
//    @ResponseBody
//    public R editEmp(String idCard){
//        R r = new R();
//        r.setCode(200);
//        r.setMsg("success");
//        List<BlackPojo> sysUserList = new ArrayList<>();
//        BlackPojo blackPojo=new BlackPojo();
//        Emp sys_emp01 = new Emp();
//        sys_emp01.setEmp_Name("admin");
//        sys_emp01.setEmp_Sex("123");
//        sys_emp01.setAge("55岁");
//        sys_emp01.setEmp_Education(1);
//        sys_emp01.setEmp_Phone("19905059595");
//        sys_emp01.setEmp_Dept("一事业部");
//        sys_emp01.setEmp_Idcard("123456");
//        blackPojo.setEmp_date(sys_emp01);
//        BlackPojo blackPojo02=new BlackPojo();
//        Emp sys_emp02 = new Emp();
//        Resume resume02=new Resume();
//        sys_emp02.setEmp_Name("admin");
//        sys_emp02.setEmp_Sex("123");
//        sys_emp02.setAge("55岁");
//        sys_emp02.setEmp_Education(1);
//        sys_emp02.setEmp_Phone("19905059595");
//        sys_emp02.setEmp_Dept("一事业部");
//        sys_emp02.setEmp_Jionpic("src/img2");
//        sys_emp02.setEmp_Idcard("123456");
//        sys_emp02.setEmp_Quitpic("src/img3");
//        blackPojo02.setEmp_date(sys_emp02);
//        resume02.setRe_selfpic("src/img1");
//        blackPojo02.setResume_date(resume02);
//
//
//
//        sysUserList.add(blackPojo);
//        sysUserList.add(blackPojo02);
//
//        r.setData(sysUserList);
//        return r;
//    }



    @RequestMapping(value = "/deleteShieldingEmp",method = RequestMethod.GET)
    @ApiOperation(value = "拉黑员工删除操作",notes = "传递身份证号码",httpMethod = "GET", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "emp_IdCard",value = "身份证号码",required = true,dataType = "String",paramType = "query"),
    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R deleteEmp(String idCard){
        R r=new R();
        r.setCode(200);
        r.setMsg("删除成功");
        r.setData(null);
        return r;
    }

    @RequestMapping(value = "/deleteAllShieldingEmp",method = RequestMethod.GET)
    @ApiOperation(value = "拉黑员工批量删除操作",notes = "传递身份证号码",httpMethod = "GET", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "emp_IdCard",value = "身份证号码",required = true,dataType = "list",paramType = "query"),
    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R empAllDelete(String idCard){
        R r=new R();
        r.setCode(200);
        r.setMsg("批量删除成功");
        r.setData(null);
        return r;
    }
    @RequestMapping(value = "/wordShieldSelect",method = RequestMethod.GET)
    @ApiOperation(value = "关键词搜索",notes = "传递字符串",httpMethod = "GET", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "word",value = "关键词",required = true,dataType = "String",paramType = "query"),
    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R select_Word(String word){
        R r=new R();
        r.setCode(200);
        r.setMsg("成功了");
        r.setData(null);
        return r;
    }


}